<include file="Public/min-header"/>
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
    <include file="Public/breadcrumb"/>
    <section class="content ">
        <!-- Main content -->
        <div class="container-fluid">
            <div class="pull-right">
                <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回"><i class="fa fa-reply"></i></a>
<!--				<a href="javascript:;" class="btn btn-default" data-url="#" onclick="get_help(this)"><i class="fa fa-question-circle"></i> 帮助</a>-->
            </div>
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title"><i class="fa fa-list"></i> 添加直播</h3>
                </div>
                <div class="panel-body ">   
                    <!--表单数据-->
                    <form method="post" id="handleposition" action="{:U('Admin/Live/liveHandle')}">
                        <!--通用信息-->
                    <div class="tab-content col-md-10">                 	  
                        <div class="tab-pane active" id="tab_tongyong">   

<!--                          	<div class="callout callout-inro">-->

<!--						        <p>1：首页和积分商城banner广告:支持jpg、jpeg、png格式上传，建议图片750*360、大小1.00M以内的图片。</p>-->
<!--								<p>2：产品分类页面广告:支持jpg、jpeg、png格式上传，建议图片宽度552*180、大小1.00M以内的图片。</p>-->

<!--				            </div>-->
                        </div> 
                            <table class="table table-bordered">
                                <tbody>
                                <tr>
                                    <td class="col-sm-2">直播名称：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control" name="name" value="{$info.name}"/>
                                        <span id="err_attr_name" style="color:#F00; display:none;"></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="col-sm-2">主播呢称：</td>
                                    <td class="col-sm-8">
                                        <input type="text" class="form-control" name="anchor_name" value="{$info.anchor_name}"/>
                                        <span id="err_attr_anchor_name" style="color:#F00; display:none;"></span>
                                    </td>
                                </tr>
                                <if condition="$info && $info.id">
                                    <tr>
                                        <td class="col-sm-2">推流地址：</td>
                                        <td class="col-sm-8">
                                            <input type="text" class="form-control" name="pusher_url" value="{$info.pusher_url}"/>
                                            <span id="err_attr_pusher_url" style="color:#F00; display:none;"></span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="col-sm-2">播放地址：</td>
                                        <td class="col-sm-8">
                                            <input type="text" class="form-control" name="player_url" value="{$info.player_url}"/>
                                            <span id="err_attr_player_url" style="color:#F00; display:none;"></span>
                                        </td>
                                    </tr>
                                </if>
                                <tr>
                                    <td>开始日期：</td>
                                    <td>
                                        <fieldset>
                                        <div class="control-group">
                                                <div class="controls">
                                                        <div class="input-prepend input-group">
                                                                <span class="add-on input-group-addon">
                                                                        <i class="glyphicon glyphicon-calendar fa fa-calendar">
                                                                        </i>
                                                                </span>
                                                                <input type="text" style="width: 300px" name="start_time" autocomplete="off" id="start_time" class="form-control" value='{$info.start_time}'>
                                                        </div>
                                                </div>
                                        </div>
                                        </fieldset>
                                    </td>
                                </tr>
                                <tr>
                                    <td>入口图：</td>
                                    <td>
                                        <div class="col-sm-3">
                                            <input type="text" class="form-control" style="width:350px;margin-left:-15px;" name="go_img" id="go_img" value="{$info.go_img}" >
                                        </div>
                                        <div class="col-sm-3">
                                            <input type="button" class="btn btn-default" onClick="GetUploadify(1,'go_img','live','')"  value="上传图片"/>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>封面图：</td>
                                    <td>
                      					<div class="col-sm-3">
                      						<input type="text" class="form-control" style="width:350px;margin-left:-15px;" name="share_img" id="share_img" value="{$info.share_img}" >
                      					</div>
                      					<div class="col-sm-3">
                                        	<input type="button" class="btn btn-default" onClick="GetUploadify(1,'share_img','live','')"  value="上传图片"/>
                                        </div>
                                    </td>
                                </tr>

                                </tbody> 
                                <tfoot>
                                	<tr>
                                	<td><input type="hidden" name="act" value="{$act}">
                                        <input type="hidden" name="id" value="{$info.id}">
                                	</td>
                                	<td class="text-right"><input class="btn btn-primary" type="button" onclick="adsubmit()" value="保存"></td></tr>
                                </tfoot>                               
                            </table>
                        </div>                           
                    </div>              
			    	</form><!--表单数据-->
                </div>
            </div>
        </div>
    </section>
</div>
<script>
function adsubmit(){
	$('#handleposition').submit();
}

$(document).ready(function() {

    $(document).on('change','.ad_link',function() {
        var t = $(this);
        var  id = t.val();

        if (id == "/pages/goods/detail/detail" ||　id == "/pages/topic/topic"||　id == "/pages/seller/seller/seller"){
            t.after('<span style="margin-left: 10px"> Id： <input type="text" style="width: 200px" class="form-control" name="objectId" value="" ></span>')
        }else{
            t.next().html('')
        }

    });

    $('#start_time').daterangepicker({
        format:"YYYY-MM-DD HH:mm",
        singleDatePicker: true,
        showDropdowns: true,
        showWeekNumbers: true,
        timePicker: true,
        timePickerIncrement: 1,
        timePicker12Hour: false,
        opens: 'left',
        buttonClasses: ['btn btn-default'],
        applyClass: 'btn-small btn-primary',
        cancelClass: 'btn-small',
        locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
    });
	
	$('#end_time').daterangepicker({
		format:"YYYY-MM-DD",
		singleDatePicker: true,
		showDropdowns: true,
		minDate:'2021-01-01',
		maxDate:'2030-01-01',
		startDate:'{:date("Y-m-d H:i")}',
		/*
        startDate: moment().startOf('day'),
        endDate: moment(),
        minDate: '01/01/2014',    //最小时间
        maxDate : moment(), //最大时间
        dateLimit : {
            days : 30
        }, //起止时间的最大间隔
        showDropdowns : true,
        showWeekNumbers : false, //是否显示第几周
        timePicker : true, //是否显示小时和分钟
        timePickerIncrement : 60, //时间的增量，单位为分钟
        timePicker12Hour : false, //是否使用12小时制来显示时间
        ranges : {
            '最近1小时': [moment().subtract('hours',1), moment()],
            '今日': [moment().startOf('day'), moment()],
            '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
            '最近7日': [moment().subtract('days', 6), moment()],
            '最近30日': [moment().subtract('days', 29), moment()]
        },
        opens : 'right', //日期选择框的弹出位置
        buttonClasses : [ 'btn btn-default' ],
        applyClass : 'btn-small btn-primary blue',
        cancelClass : 'btn-small',
        format : 'YYYY-MM-DD HH:mm:ss', //控件中from和to 显示的日期格式
        separator : ' to ',
        */
	    locale : {
            applyLabel : '确定',
            cancelLabel : '取消',
            fromLabel : '起始时间',
            toLabel : '结束时间',
            customRangeLabel : '自定义',
            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],
            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月','七月', '八月', '九月', '十月', '十一月', '十二月' ],
            firstDay : 1
        }
	});

});

</script>
 </body>
 </html>